import { defineStore } from 'pinia'
import axios from 'axios';
interface login {
  account: string,
  password: string,
}
interface login_in {
  account: string,
  password: string,
  name: string
}
export const useEntryStore = defineStore('entry', {
  state: () => {
    return {
      token: '',
      id: 0
    }
  },
  actions: {
    async sign_user(login: login) {
      const response = await axios.post("http://192.168.1.3:8000/users/userLogin", login)
      return response.data;
    },
    async sign_root(login: login) {
      const response = await axios.post("http://192.168.1.3:8000/admin/login", login)
      return response;
    },
    async sign_create(login_in: login_in) {
      const response = await axios.post("http://192.168.1.3:8000/users/createUser", login_in)
      return response;
    }
  },

})